<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="HNUST/../../user/css/pintuer.css">
<link rel="stylesheet" href="HNUST/../../user/css/admin.css">
<script src="HNUST/../../user/js/jquery.js"></script>
<script src="HNUST/../../user/js/pintuer.js"></script>
 <link rel="stylesheet" type="text/css" href="HNUST/../../dist/css/wangEditor.min.css">
<script src="HNUST/../../dist/js/lib/jquery-1.10.2.min.js"></script>
<script src="HNUST/../../dist/js/wangEditor.min.js"></script>
<style type="text/css">
        #editor-trigger {
            height: 400px;
            /*max-height: 500px;*/
        }
        .container {
            width: 100%;
            margin: 0 auto;
            position: relative;
        }
    </style>
    
    <script type="text/javascript">
	$(function() {
		var path, clip = $("#allUrl"), FileReader = window.FileReader;
		$("#file").change(function() {
			if (FileReader) {//chrome浏览器处理  
				var reader = new FileReader(), file = this.files[0];
				reader.onload = function(e) {
					clip.attr("src", e.target.result);//这里是把图片转成64位数据存入<img>中的src里  
				};
				reader.readAsDataURL(file);
				//这里需要延迟一下，否则无法放入文本框内  
				//setTimeout("showchange()",1000);  
			} else {//其他浏览器处理，火狐在这里就不写出来了，网上资料很多  
				path = $(this).val();
				if (/"\w\W"/.test(path)) {
					path = path.slice(1, -1);
				}
				clip.attr("src", path);
			}
		});

	})
</script>
</head>
<body>
<div class="panel admin-panel margin-top">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>添加内容</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="ColumnAdd?pageNow=1" enctype="multipart/form-data">
    <input type="hidden" name="column_id" value=""/>
    <div class="form-group">
        <div class="label">
          <label>美食标题：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="column_name" value=""/>
        </div>
      </div>
    
      <div class="form-group">
        <div class="label">
          <label>产品图片：</label>
        </div>
        <div class="field">
        <img id="allUrl" src="" width="200" height="229" />
		<input type="file" name="pic" accept="image/gif,image/jpeg,image/jpg" id="file"/>
          <div class="tips"></div>
        </div>
      </div> 
      
        <div class="form-group">
        <div class="label">
          <label>价格：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="column_jg" value=""/>
        </div>
      </div>
      
      <div class="form-group">
          <div class="label">
            <label>地区：</label>
          </div>
          <div class="field">
            <select name="column_tavern" class="input w50">
              <option value="鼎城区">鼎城区</option>
              <option value="武陵区">武陵区</option>
              <option value="安乡县">安乡县</option>
              <option value="汉寿县">汉寿县</option>
              <option value="津市">津市</option>
              <option value="桃源县">桃源县</option>
              <option value="澧县">澧县</option>
              <option value="石门县">石门县</option>
              <option value="临澧县">临澧县</option>
            </select>
            <div class="tips"></div>
          </div>
        </div>
      <div class="form-group">
        <div class="label">
          <label>具体路线：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="column_lx" value=""/>
        </div>
      </div>
      
       <div class="form-group">
        <div class="label">
          <label>描述：</label>
        </div>
        <div class="field">
          <textarea id="textarea1" style="height:300px;max-height:400px;" name="column_ms">
    <p>请输入内容...</p>
</textarea>
          <div class="tips"></div>
        </div>
      </div> 


<!--这里引用jquery和wangEditor.js-->
<script type="text/javascript">
    // 获取元素
    var textarea = document.getElementById('textarea1');
    // 生成编辑器
    var editor = new wangEditor(textarea);
    editor.create();
</script>  
      
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
</body>
</html>